<!DOCTYPE html>
<html>
<head></head>
<body style="margin:0;padding:0;">
    {if $ret}
    <script>
        var ret = eval('({$ret|html})');
        parent.{$cb}(ret);
    </script>
    {/if}
    <style>
        #tool_file_input{
            width:113px;
            font-size:100px;
            border:none;
            height:30px;
            position:absolute;
            z-index:12; 
            filter:alpha(opacity:0);
            opacity:0;
            cursor:pointer;
            overflow:hidden;
        }
        .tool_upload_btn {
            display:block; 
            width:113px;
            padding: 5px 0 0 0;
            text-align:center;
            background:#880000;
            border-bottom:1px solid #ddd;
            color:#fff;
            font-size:14px;
            height:20px;
        }

        .tool_upload_btn_hover {
            background:#cc0000;
        }

        .tool_image_error{
            width:150px;
            float:left;
            font-size:12px;
            color:red;
            padding:20px 0 0 20px;
        }
    </style>
    <script src="{__DATA_URL__}js/jquery-1.8.2.min.js"></script>
    <script>
        $(function(){
            $('#tool_file_input').bind('change',function(){
                if($(this).val().match(/^.*\.(gif|jpg|png|jpeg)$/i)){
                    $('#form1').submit();
                }else{
                    alert('请选择GIF或JPG,PNG后缀文件!');
                }
            });
        });
    </script>
    <form id="form1" style="margin:0;padding:0;" action="{url:'admin@system-upload-cb-%s|false',$cb}" method="post" enctype="multipart/form-data">
        <input type="hidden" name="water" value="{$water}"/>
        <input type="hidden" name="tw" value="{$tw}"/>
        <input type="hidden" name="th" value="{$th}"/>
        <input type="file" id="tool_file_input" name="filename" />
        <span class="tool_upload_btn">上传文件</span>
    </form>
</body>
</html>